package cn.itcast.order.listen;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.stereotype.Component;

/**
 * @author danDong
 * @date 2025-04-14 16:10:08
 */
@Component
public class MyEventPublisher {
    @Autowired
    private ApplicationEventPublisher eventPublisher;

    public void publishEvent(String message) {
        MyCustomEvent event = new MyCustomEvent(eventPublisher, message);
        eventPublisher.publishEvent(event);
    }
}
